<?php
namespace Avos\tests;
use Avos\AVFile;
use Avos\TestFixture;
class AVFileTest extends TestFixture {

	public function setUp(){

	}

    public function uploadfile()
    {
        $upload = new AVFile('image/png',$_FILES['image']['tmp']);
        $save = $upload->save('1.png');
        var_dump($save);
    }


	public function saveExpectName(){
		$return = \Avos\Core::getCodeCoverageWrapper('AVFile', array('text/plain','Working at AVOS Cloud is great!'));
		$save = $return->save('hello.txt');

		\Avos\Assert::isTrue( property_exists($save,'name') );
	}

	public function deleteWithUrlExpectTrue(){
		$file = new AVFile('text/plain','Working at AVOS Cloud is great!');
		$save = $file->save('hello.txt');

		//SET BOTH ARGUMENTS BELOW TO FALSE, SINCE WE ARE DELETING A FILE, NOT SAVING ONE
		$todelete = new AVFile;
		$return = $todelete->delete($save->name);

		\Avos\Assert::isTrue( $return );
	}

}

?>
